package com.ztools.common.util.common.enumUnit;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: seeTools
 * @Date: 2023/6/5  13:14
 * @Version 1.0
 */
@Getter
@AllArgsConstructor
public enum PaymentTypeEnum {

    /**
     * 微信支付
     */
    WECHAT("wechat", "微信支付"),

    /**
     * 积分兑换
     */
    POINT("point", "积分兑换"),

    /**
     * 积分加钱换购
     */
    POINT_PLUS_MONEY("pointPlusMoney", "积分加钱换购");

    /**
     * 支付方式
     */
    private final String paymentType;

    /**
     * 名称
     */
    private final String name;


    /**
     * @param paymentType 消费类型
     * @return PaymentTypeEnum
     */
    public static PaymentTypeEnum getEnum(String paymentType) {
        for (PaymentTypeEnum item : PaymentTypeEnum.values()) {
            if (item.getPaymentType().equals(paymentType)) {
                return item;
            }
        }
        return null;
    }
}
